from abc import ABC, abstractmethod
import numpy as np
from typing import List
from enum import Enum
from ..function.recognize import OcrResult

class OcrEngine(Enum):
    """OCR引擎类型"""
    EASY_OCR = "easyocr"
    PADDLE_OCR = "paddleocr"
    TESSERACT = "tesseract"

class BaseOcrEngine(ABC):
    """OCR引擎基类"""
    @abstractmethod
    def recognize(self, image: np.ndarray, confidence_threshold: float = 0.5) -> List[OcrResult]:
        """
        识别图片中的文字
        
        Args:
            image: 图片数据
            confidence_threshold: 置信度阈值
            
        Returns:
            List[OcrResult]: 识别结果列表
        """
        pass